<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    function Fn(m){
        // this.msg = m;
    }
    Fn.prototype.show = function(){
        console.log(this.msg);
    }
    const f = new Fn("admin");
    console.log(f);
    f.show();

    // ========

    class Test{
        constructor(m){
            // 构造函数
            this.msg = m;
        }
        // 原型部分
        show(){
            console.log(this.msg);
        }
    }
    const t = new Test("root")
    console.log(t);
    t.show();


    
</script>
</html>